<template>
  <div class="tag-sex" :class="'sex_' + value" v-show="value !== ''">
    <slot>
      <span v-if="this.value === '1'">男♂</span>
      <span v-else-if="this.value === '0'"> 女♀</span>
      <span v-else-if="this.value === '2'">未知？</span>
    </slot>
  </div>
</template>

<script>
export default {
  name: 'tag-sex',
  props: {
    value: String
  },
  data() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.tag-sex {
  display: inline-block;
  line-height: 1;
  padding: 8px 10px;
  text-align: center;
  color: #FFF;
  background-color: #4098f5;
  border-radius: 4px;

  &.sex_0 {
    // 女
    background-color: #f76b6b;
  }

  &.sex_2 {
    // 未知
    background-color: #fd8015;
  }
}
</style>
